<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理后台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.4 -->
    <link href="/public/static/Tpshop/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- FontAwesome 4.3.0 -->
    <link href="/public/static/Tpshop/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons 2.0.0 --
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/public/static/Tpshop/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- AdminLTE Skins. Choose a skin from the css/skins
        folder instead of downloading all of them to reduce the load. -->
    <link href="/public/static/Tpshop/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="/public/static/Tpshop/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.10.0/css/bootstrap-select.min.css">
    <link href="/public/static/admin/css/ratuo.css" rel="stylesheet">
    <!-- jQuery 2.1.4 -->
    <script src="/public/static/Tpshop/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="/public/static/Tpshop/js/common.js"></script>
    <script src="/public/static/Tpshop/js/myFormValidate.js"></script>
    <script src="/public/static/Tpshop/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/public/static/Tpshop/js/layer/layer-min.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
    <script src="/public/static/Tpshop/js/myAjax.js"></script>
    <script src="/public/static/admin/js/jquery.validate.js"></script>
    <link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" />




</head>

        <style>
            td label{color : #FF0000;}
        </style>
<div class="wrapper">
    <!-- Content Header (Page header) -->
    <section class="content">
    <!-- Main content -->
    <!--<div class="container-fluid">-->
    <div class="row">
      <div class="col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-list"></i> 用户信息</h3>
            </div>
            <div class="panel-body">
                <form  method="post"  id="commentForm">
                    <input type="hidden" id="user_id" name="user_id" value="{$user.user_id}">
                    <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <td width="150">会员昵称:</td>
                        <td width="500"><input type="text" class="form-control" name="nickname" id="nickname" value="{$user.nickname}" disabled></td>
                        <td ><label for="nickname"></label></td>
                    </tr>
                    <tr>
                        <td>会员手机:</td>
                        <td><input type="text" class="form-control" name="mobile" id="mobile" value="{$user.mobile}" disabled></td>
                        <td><label for="mobile"></label></td>
                    </tr>

                    <!-- <tr>
                        <td>邮件地址:</td>
                        <td><input type="text" class="form-control" id="email" name="email" value="{$user.email}" disabled></td>
                        <td><label for="email"></label></td>
                    </tr> -->
                    <tr>
                        <td>新的密码:</td>
                        <td><input type="password" class="form-control" id="password" name="password"></td>
                        <td><label for="password">* 密码为空则不修改</label></td>
                    </tr>
                    <tr>
                        <td>确认密码:</td>
                        <td><input type="password" class="form-control" id="password2" name="password2"></td>
                        <td><label for="password2"></label></td>
                    </tr>
                    <!--<tr>-->
                        <!--<td>会员等级:</td>-->
                        <!--<td>{$user.user_rank}</td>-->
                    <!--</tr>-->
                    <!--<tr>
                        <td>会员 QQ:</td>
                        <td><input class="form-control" type="text" name="qq" id="qq" value="{$user.qq}"></td>
                        <td><label for="qq"></label></td>
                    </tr>-->

                    <!--<tr>
                        <td>消费积分:</td>
                        <td><input type="text" class="form-control" name="pay_points" value="{$user.pay_points}" disabled></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>用户资金:</td>
                        <td><input type="text" class="form-control" name="user_money" value="{$user.user_money}" disabled></td>
                        <td></td>
                    </tr>-->
                    <!--<tr>
                        <td>会员性别:</td>
                        <td id="order-status">
                            <input name="sex" type="radio" value="0" <if condition="$user['sex'] eq 0">checked</if> >保密 &nbsp;&nbsp;
                            <input name="sex" type="radio" value="1" <if condition="$user['sex'] eq 1">checked</if> >男 &nbsp;&nbsp;
                            <input name="sex" type="radio" value="2" <if condition="$user['sex'] eq 2">checked</if> >女
                        </td>
                        <td><label for="nickname"></label></td>
                    </tr>-->
                    <tr>
                        <td>注册时间:</td>
                        <td>{$user.reg_time|date='Y-m-d H:i'}</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <button type="submit" class="btn btn-info">
                                <i class="ace-icon fa fa-check bigger-110"></i> 保存
                            </button>
                            <!--<a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default pull-right" data-original-title="返回"><i class="fa fa-reply"></i></a>-->
                        </td>
                        <td></td>
                    </tr>
                    </tbody>
                </table>
                </form>

            </div>
        </div>
 	  </div> 
    </div>    <!-- /.content -->
   </section>
</div>
<script>
    $(function() {
        $("#commentForm").validate({
            rules: {
                nickname: { required: true},
                email:    {
                    email:  true ,
                    remote :{
                    url: "{:url('Admin/User/getAjaxVerify')}",
                    type: "get",
                    dataType: "json",
                    data:  {
                        email: function() {
                            return $("#email").val();
                        },
                        user_id: $("#user_id").val()
                    }}
                },
                mobile:   {
                    isMobile: true,
                    remote :{
                        url: "{:url('Admin/User/getAjaxVerify')}",
                        type: "get",
                        dataType: "json",
                        data:  {
                            mobile: function() {
                                return $("#mobile").val();
                            },
                            user_id: $("#user_id").val()
                        }}
                },

                password: { rangelength:[5,15]},
                password2:{ equalTo:"#password"},
                qq:{ digits:true}
            },
            messages: {
                nickname:{
                    required:"昵称不能为空"
                },
                email: {
                    email: "请输入正确的邮箱",
                    remote : "邮箱已存在,请使用其他的"
                },
                mobile: {
                    isMobile : "请正确填写您的手机号码",
                    remote :"手机已存在,请使用其他的"
                },
                password: {
                    rangelength: "密码长度为5-15"
                },
                password2:{
                    equalTo:"两次密码不相同"
                },
                qq:{
                    digits: "只能输入数字"
                }

            },submitHandler:function(form) {
                ajax_submit_form('commentForm','{:url("User/detail")}');
            },
            errorPlacement: function (error, element) {
                $(element).closest("form").find("label[for='" + element.attr("id") + "']").html(error);
            },
            errorElement: "span"

        });

        jQuery.validator.addMethod("isMobile", function (value, element) {
            var length = value.length;
            var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
            return this.optional(element) || (length == 11 && mobile.test(value));
        }, "请正确填写您的手机号码");
        jQuery.validator.addMethod("isStr", function(value, element) {
            var str = /^[a-zA-Z\u4e00-\u9fa5]+$/;
            return this.optional(element) || (str.test(value));
        }, "只能输入字母或者中文");
    });






</script>

</body>
</html>